'use strict';

const { Controller } = require('egg');
const {success} = require('../extend/api')
class ArticleController extends Controller {
  constructor(ctx){ 
    super(ctx);
  }

  async createArticle(){
    const { ctx,service } = this;
    const body = ctx.request.body
    const res = await service.article.createArticle(body)
    success({ctx,res})
  }

  async getArticleData(){
    const { ctx,service } = this;
    const res = await service.article.getArticleData()
    success({ctx,res})
  }

  async passArticle(){
    const { ctx,service } = this;
    const body = ctx.request.body
    const res = await service.article.passArticle(body)
    success({ctx,res})
  }
  
  async deleteArticle(){
    const { ctx,service } = this;
    const body = ctx.request.body
    const res = await service.article.deleteArticle(body)
    success({ctx,res})
  }

  async clear(){
    const { ctx,service } = this;
    const body = ctx.request.body
    const res = await service.article.clear(body)
    success({ctx,res})
  }

}

module.exports = ArticleController;
